package co.fitstart.entity.reference;

import com.demo2do.core.utils.Alias;

/**
 * 
 * @author mohanlan
 *
 */
@Alias("country")
public enum Country {
    
    CHINA("中国"),
    
    OTHER("其他");
    
    private String description;
    
    /**
     * @param description
     */
    private Country(String description) {
        this.description = description;
    }
    
    /**
     * 
     * @param alias
     * @return
     */
    public static Country aliasOf(String alias) {
        for (Country country : Country.values()){
            if (country.getDescription().equalsIgnoreCase(alias)) {
                return country;
            }
        }
        return null;
        
    }
    
    /**
     * 
     * @param name
     * @return
     */
    public static Country privateValueOf(String name) {
    	for (Country country : Country.values()){
            if (country.name().equalsIgnoreCase(name)) {
                return country;
            }
        }
		return null;
    	
    }
    
    /**
     * @return the description
     */
    public String getDescription() {
        return description;
    }
}
